// extract module
var http = require('http');
var fs = require('fs');
var ejs = require('ejs');

// create and run web server
http.createServer(function(request, response) {
	// read ejs file
	fs.readFile('data.ejs', 'utf8', function(error, data) {
		response.writeHead(200, {'Content-Type': 'text/html'});
		response.end(ejs.render(data, {
			name: 'Sejoon',
			description: 'Hello EJS with Node.js'
		}));
	});
}).listen(52273, function() {
	console.log('Server running at http://127.0.0.1:52273');
});